; _________________________________________________
;| Omni-Psych Super Dizzy [LE] Version 3  by Seven |
; ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
;===============================================================================
;======================================<Other>==================================
;===============================================================================

;===============================================================================
;                    Version  3  THE Challenge Edition
;===============================================================================
;=====The Number's Next to the constant's are optional Versions of [LE]=========
;===============================================================================
;==And For Those Who Wish To Seek The Hardest Challenge, Use Her Optional Stats=
;===============================================================================

;===============================================================================
;===============================================================================

; Stand
[Statedef 0]
type = S
physics = S
sprpriority = 0

[State dizzy]
type = ChangeState
trigger1 = var(9)>= 512
trigger1 = alive = 1 && roundstate = 2
value = 5300
ctrl = 1
ignorehitpause = 1

[State anim]
type = ChangeAnim
trigger1 = anim!= 0 && anim!= 5
trigger2 = anim = 5 && animtime = 0
value = 0

[State vel]
type = velset
trigger1 = time = 0
y = 0

[State vel]
type = velset
triggerall = prevstateno!= 101
trigger1 = abs(vel x) < 2
trigger2 = time = 4
x = 0


;===============================================================================
;===============================================================================
; Jump Start
[Statedef 40]
type = S
physics = S
anim = 40
ctrl = 0
facep2 = 1
sprpriority = 1



[State var]
type = varset
trigger1 = time = 0
sysvar(1) = 0
[State var]
type = varset
trigger1 = command = "holdfwd"
sysvar(1) = 1
[State var]
type = varset
trigger1 = command = "holdback"
sysvar(1) = -1


[State explod]
type = Explod
trigger1 = animtime = -1
anim = 4601
scale = .5,.5
sprpriority = 5
ownpal = 1
persistent = 0

[State vel]
type = velset
trigger1 = animtime = 0
x = ifelse(sysvar(1)=0,const(velocity.jump.neu.x),ifelse(sysvar(1)=1,const(velocity.jump.fwd.x),const(velocity.jump.back.x)))
y = const(velocity.jump.y)

[State vel]
type = velset
trigger1 = animtime = 0
trigger1 = prevstateno = 100
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)

[State vel]
type = velset
trigger1 = animtime = 0 && command!= "holdup"
trigger1 = prevstateno = 100
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)
y = const(velocity.jump.y)*.75

[State vel]
type = velset
trigger1 = animtime = 0 && command!= "holdup"
trigger1 = prevstateno!= 100
x = ifelse(sysvar(1)=0,const(velocity.jump.neu.x),ifelse(sysvar(1)=1,const(velocity.jump.fwd.x),const(velocity.jump.back.x)))
y = const(velocity.jump.y)*.75

[State snd]
type = PlaySnd
trigger1 = animtime = 0
value = 40,0

[State 40]
type = ChangeState
trigger1 = animtime = 0 && command!= "holdup"
value = 41
ctrl = 1

[State 40]
type = ChangeState
trigger1 = animtime = 0
value = 50
ctrl = 1
;===============================================================================
;===============================================================================

[Statedef 41]
type = A
movetype = I
physics = A
anim = 41

[State 41]
type = ChangeAnim
trigger1 = vel y > -2
trigger1 = selfanimexist(anim+3)
value = anim+3
persistent = 0

[State land]
type = ChangeState
trigger1 = pos y >= 0 && vel y > 0
value = 52

;===============================================================================
;===============================================================================
; Hi Jump
[Statedef 42]
type = S
physics = S
anim = 40
ctrl = 1
sprpriority = 1

[State 42]
type = AssertSpecial
trigger1 = 1
flag = noairguard

[State var]
type = varset
trigger1 = time = 0
sysvar(1) = 0
[State var]
type = varset
trigger1 = command = "holdfwd"
sysvar(1) = 1
[State var]
type = varset
trigger1 = command = "holdback"
sysvar(1) = -1

[State explod]
type = Explod
trigger1 = animtime = -1
anim = 4601
scale = .5,.5
sprpriority = 5
ownpal = 1
persistent = 0

[State vel]
type = velset
trigger1 = animtime = 0
x = ifelse(sysvar(1)=0,const(velocity.jump.neu.x),ifelse(sysvar(1)=1,const(velocity.jump.fwd.x),const(velocity.jump.back.x)))*1.75
y = const(velocity.jump.y)*1.25

[State image]
type = AfterImage
trigger1 = animtime = 0
time = 24
length = 20
paladd = -20,-20,-20
palmul = .95,.95,.95
timegap = 1
framegap = 1
trans = add

[State snd]
type = PlaySnd
trigger1 = animtime = 0
value = 40,1

[State 42]
type = ChangeState
trigger1 = animtime = 0
value = 50
ctrl = 1

;===============================================================================
;===============================================================================
; AirJump Start
[Statedef 45]
type = A
physics = N
velset = 0,0
ctrl = 1
facep2 = 1

[State anim]
type = ChangeAnim
trigger1 = selfanimexist(44)
value = 44

[State anim]
type = ChangeAnim
trigger1 =!selfanimexist(44)
value = 41

[State var]
type = varset
trigger1 = time = 0
sysvar(1) = 0
[State var]
type = varset
trigger1 = command = "holdfwd"
sysvar(1) = 1
[State var]
type = varset
trigger1 = command = "holdback"
sysvar(1) = -1

[State vel]
type = velset
trigger1 = time = 2
x = ifelse(sysvar(1)=0,const(velocity.airjump.neu.x),ifelse(sysvar(1)=1,const(velocity.airjump.fwd.x),const(velocity.airjump.back.x)))
y = const(velocity.airjump.y)

[State end]
type = ChangeState
trigger1 = time = 2
value = 50
ctrl = 1

;===============================================================================
;===============================================================================
; Jump Up
[Statedef 50]
type = A
physics = A

[State 50]
type = AssertSpecial
trigger1 = prevstateno = 42
flag = noairguard

[State var]
type = varset
trigger1 = time = 0
sysvar(1) = 0

[State 50]
type = ChangeAnim
trigger1 = time = 0
value = ifelse((vel x)=0||prevstateno=103,41,ifelse((vel x)>0,42,43))

[State 50]
type = ChangeAnim
trigger1 = vel y > -2
trigger1 = selfanimexist(anim+3)
value = anim+3
persistent = 0

;===============================================================================
;===============================================================================

; Jump Down (empty state for compatibility)
[Statedef 51]
type = A
movetype = I
physics = N
anim = 44

[State vel]
type = veladd
trigger1 = 1
y = ifelse(fvar(14)=1,.40,(const(movement.yaccel)))

[State land]
type = ChangeState
trigger1 = pos y >= 0 && vel y > 0
value = 52

;===============================================================================
;===============================================================================

; Jump Land
[Statedef 52]
type = S
physics = S
anim = 47
velset = 0,0
ctrl = 1

[State explod]
type = RemoveExplod
trigger1 = 1
ID = 200

[State pos]
type = posset
trigger1 = time = 0
y = 0

[State ctrl]
type = ctrlset
trigger1 = var(14) = 0 && time = 4
value = 1

[State end]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1

;===============================================================================
;===============================================================================
; Run Fwd
[Statedef 100]
type = S
physics = N
anim = 100
velset = 0,0
ctrl = 1
sprpriority = 1


[State 100]
type = AssertSpecial
trigger1 = 1
flag = noautoturn
flag2 = nowalk

[State vel]
type = velset
trigger1 = time < 2
x = 0
[State vel]
type = veladd
trigger1 = time = 2
x = const(velocity.run.fwd.x)
[State vel]
type = veladd
trigger1 = time = [5,29]
x = .1

[State ctrl]
type = ctrlset
trigger1 = time = 10
value = 1

[State power]
type = poweradd
trigger1 = 1
value = 2

[State 100]
type = ChangeState
trigger1 = time >= 9
trigger1 = command!= "holdfwd"
value = 101

[Statedef 101]
type = S
physics = S
anim = 101
velset = vel x/1.5,0
ctrl = 1

[State pos]
type = posset
trigger1 = 1
y = 0

[State snd]
type = PlaySnd
trigger1 = time = 1
value = 101,0

[State ctrl]
type = ctrlset
trigger1 = time = 5
value = 1

[State end]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1

;===============================================================================
;===============================================================================
; Run Back
[Statedef 105]
type = A
movetype = I
physics = N
anim = 105
velset = 0,0
ctrl = 1
sprpriority = 1

[State explod]
type = Explod
trigger1 = animtime = -1
anim = 70
scale = .4,.4
pos = 0,-20
sprpriority = 5
ownpal = 1
persistent = 0

[State snd]
type = PlaySnd
trigger1 = time = 1
value = S101,0
volume = 255



[State vel]
type = velset
trigger1 = time = 5
x = const(velocity.run.back.x)
y = const(velocity.run.back.y)

[State vel]
type = veladd
trigger1 = time >= 5
y = .45

[State hit]
type = NotHitBy
trigger1 = time >= 5
value = SCA
[State 105]
type = PlayerPush
trigger1 = time >= 5
value = 0

[State snd]
type = PlaySnd
trigger1 = time = 5
value = 105,0

[State land]
type = ChangeState
trigger1 = pos y >= 0 && vel y > 0
value = 106

;===============================================================================
;===============================================================================

; Run Back2 (land)
[Statedef 106]
type = S
movetype = I
physics = S
anim = 106
velset = 0,0
ctrl = 1

[State pos]
type = posset
trigger1 = time = 0
y = 0

[State end]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1

;===============================================================================
;===============================================================================

; Air Dash
[Statedef 102]
type = A
physics = N
velset = 0,0
ctrl = 1

[State 102]
type = AssertSpecial
trigger1 = 1
flag = noairguard

[State var]
type = varadd
trigger1 = time = 0
var(14) = -1
persistent = 0
[State var]
type = varadd
trigger1 = prevstateno = [600,799]
trigger1 = time = 0
var(14) = -1
persistent = 0

[State var]
type = varset
trigger1 = time = 0
sysvar(1) = 1
[State var]
type = varset
trigger1 = time = 0
trigger1 = command = "holdback"
sysvar(1) = -1

[State anim]
type = ChangeAnim
trigger1 = time = 0
value = ifelse(sysvar(1)=-1,107,102)

[State air dash dust]
type = Helper
trigger1 = time = 0
name = "air_dash"
stateno = 4610
pos = 0,const(size.mid.pos.y)
ownpal = 1
persistent = 0

[State vel]
type = velset
trigger1 = time = 0
x = ifelse(sysvar(1)=-1,-const(velocity.run.fwd.x)*1.25,const(velocity.run.fwd.x)*1.5)

[State snd]
type = PlaySnd
trigger1 = time = 1
value = 102,0

[State ctrl]
type = ctrlset
trigger1 = time = 5
value = 1

[State 102]
type = ChangeState
trigger1 = time = 12
value = 103

[State land]
type = ChangeState
trigger1 = pos y >= 0 && vel y > 0
value = 52

[Statedef 103]
type = A
movetype = I
physics = N
anim = ifelse(vel x <0,108,103)
velset = vel x/2,0
ctrl = 1
facep2 = 1

[State 103]
type = AssertSpecial
trigger1 = 1
flag = noairguard

[State 103]
type = ChangeState
trigger1 = animtime = 0
;trigger1 = pos y >= 0 && vel y > 0
value = 51

;===============================================================================
;===============================================================================
; Air dash dust
[Statedef 4610]
type = A
movetype = I
physics = N
anim = 4610
velset = 0,0
ctrl = 1
sprpriority = 2

[State 4610]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State air dash dust]
type = Helper
trigger1 = time = 0
name = "dust_p"
stateno = 4611
ID = 4611
ownpal = 1

[State turn]
type = turn
trigger1 = parent,sysvar(1) = -1 && time = 0

[State image]
type = AfterImage
trigger1 = time = 0
time = 32
length = 5
paladd = -20,-20,-10
palmul = .95,.95,.95
timegap = 1
framegap = 1
trans = add

[State pal]
type = PalFX
trigger1 = time = 0
time = 32
sinadd = -256,-256,-256,128
ignorehitpause = 1

[State end]
type = DestroySelf
trigger1 = time = 72

;===============================================================================
;===============================================================================

[Statedef 4611]
type = A
movetype = I
physics = N
anim = 4611
velset = 0,0
ctrl = 1

[State 4611]
type = AssertSpecial
trigger1 = 1
flag = invisible
[State bind]
type = BindToRoot
trigger1 = 1
facing = 1
pos = 0,const(size.mid.pos.y)

[State air dash dust]
type = Helper
trigger1 = root,stateno = 102
trigger1 =(time = [0,9])&& timemod = 2,0
name = "dust"
stateno = 4612
ID = 4612
pos = -random&15,-15+random&15
ownpal = 1

[State end]
type = DestroySelf
trigger1 = time = 72

;===============================================================================
;===============================================================================

[Statedef 4612]
type = A
movetype = I
physics = N
anim = 4611
velset = 0,0
ctrl = 1

[State 4612]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State vel]
type = velset
trigger1 = time = 0
x = (root,vel x/5)*(1+(random&20)/25)
y = 1-(random&100)/50
[State vel]
type = veladd
trigger1 = 1
x = -(vel x/10)*(random&50)/100
y = -(1-(random&100)/50)/5

[State explod]
type = Explod
trigger1 = time = 0
anim = 4611
ID = 4611
vel = (root,vel x/5)*(1+(random&20)/25),1-(random&100)/50
accel = -(vel x/10)*(random&50)/100,-(1-(random&100)/50)/5
random = 30,30
removetime = 40
scale = .5,.5
sprpriority = 2

[State pal]
type = PalFX
trigger1 = time = 8
time = 32
sinadd = -256,-256,-256,128
ignorehitpause = 1

[State explod]
type = RemoveExplod
trigger1 = time = 40
ID = 4611
[State end]
type = DestroySelf
trigger1 = time = 40

;===============================================================================
;===============================================================================
; Guard (start)
[Statedef 120]
type = U
physics = U
anim = 120

[State type]
type = StateTypeSet
trigger1 = fvar(4) = 1 && statetype!= A
trigger1 = command!= "holddown"
statetype = S
[State type]
type = StateTypeSet
trigger1 = fvar(4) = 1 && statetype!= A
trigger1 = command = "holddown"
statetype = C

[State anim]
type = ChangeAnim
trigger1 = fvar(4) = 1
value = 130+(statetype=C)+(statetype=A)*2

[State anim]
type = ChangeAnim
trigger1 = fvar(4) = 0 && time = 0
value = 120+(statetype=C)+(statetype=A)*2

[State type]
type = StateTypeSet
trigger1 = time = 0 && statetype = S
physics = S
[State type]
type = StateTypeSet
trigger1 = time = 0 && statetype = C
physics = C
[State type]
type = StateTypeSet
trigger1 = time = 0 && statetype = A
physics = A

[State 120]
type = ChangeState
trigger1 = animtime = 0
value = 130+(statetype=C)+(statetype=A)*2

;===============================================================================
;===============================================================================
; Dash Cancell
[Statedef 950]
type = S
physics = S
anim = 100
velset = 0,0
ctrl = 1

[State var]
type = varadd
trigger1 = time = 0
var(14) = 1
persistent = 0

[State image]
type = AfterImage
trigger1 = time = 0
time = 12
length = 20
paladd = -20,-20,-20
palmul = .95,.95,.95
timegap = 1
framegap = 1
trans = add

[State 950]
type = ChangeState
trigger1 = time = 0
value = 100

;===============================================================================
;===============================================================================
; Jump Cancell
[Statedef 951]
type = A
movetype = I
physics = A
anim = 41
velset = 0,0
ctrl = 1

[State var]
type = varadd
trigger1 = time = 0
var(14) = 1
persistent = 0

[State var]
type = varset
trigger1 = time = 0
sysvar(1) = 0
[State var]
type = varset
trigger1 = command = "holdfwd"
sysvar(1) = 1
[State var]
type = varset
trigger1 = command = "holdback"
sysvar(1) = -1

[State vel]
type = velset
trigger1 = time = 0
x = ifelse(sysvar(1)=0,const(velocity.jump.neu.x),ifelse(sysvar(1)=1,const(velocity.jump.fwd.x),const(velocity.jump.back.x)))
y = ifelse(var(14)>=2||fvar(14)=1,const(velocity.airjump.y)+fvar(14),const(velocity.jump.y))

[State 951]
type = ChangeAnim
trigger1 = vel y > -2
trigger1 = selfanimexist(anim+3)
value = anim+3
persistent = 0

[State image]
type = AfterImage
trigger1 = time = 0
time = 12
length = 20
paladd = -20,-20,-20
palmul = .95,.95,.95
timegap = 1
framegap = 1
trans = add

[State 951]
type = ChangeState
trigger1 = time = 1
value = 50
ctrl = 1

;===============================================================================
;===============================================================================
; Chase Jump
[Statedef 952]
type = A
movetype = I
physics = N
anim = 41
velset = 0,0
ctrl = 1

[State explod]
type = Explod
trigger1 = time = 0
anim = 4601
scale = .5,.5
sprpriority = 5
ownpal = 1

[State 952]
type = AssertSpecial
trigger1 = 1
flag = noairguard

[State explod]
type = RemoveExplod
trigger1 = 1
ID = 200

[State vel]
type = velset
trigger1 = time = 0
x = 3.8
y = -14

[State var]
type = varset
trigger1 = time = 0
fvar(14) = 1

[State 952]
type = ChangeAnim
trigger1 = vel y > -2
trigger1 = selfanimexist(anim+3)
value = anim+3
persistent = 0

[State vel]
type = veladd
trigger1 = 1
y = .35

[State image]
type = AfterImage
trigger1 = time = 0
time = 24
length = 20
paladd = -20,-20,-20
palmul = .95,.95,.95
timegap = 1
framegap = 1
trans = add

[State snd]
type = PlaySnd
trigger1 = time = 0
value = 40,1

[State ctrl]
type = ctrlset
trigger1 = time >= 8
value = 1

[State pos]
type = posset
trigger1 = pos y >= 0 && vel y > 0
y = 0
[State land]
type = ChangeState
trigger1 = pos y >= 0 && vel y > 0
value = 52
ctrl = 1

;===============================================================================
;===============================================================================
; Roman Cancell
[Statedef 960]
type = U
physics = U
velset = vel x/2,vel y/2
poweradd = -ifelse(movehit,100,50)
movehitpersist = 1

[State type]
type = StateTypeSet
trigger1 = statetype = S
physics = S
[State type]
type = StateTypeSet
trigger1 = statetype = C
physics = C
[State type]
type = StateTypeSet
trigger1 = statetype = A
physics = A

[State var]
type = varset
trigger1 = time = 0
var(14) = 0
persistent = 0

[State pal]
type = PalFX
trigger1 = time = 0
time = 13
sinadd = 128,128,128,26
ignorehitpause = 1

[State roman cancell effect]
type = Helper
trigger1 = time = 0
name = "roman_p"
stateno = 4650
ID = 4650
pos = 0,const(size.mid.pos.y)/(1+statetype=C)
ownpal = 1
persistent = 0

[State end]
type = ChangeState
trigger1 = time = 0
value = ifelse(statetype=A,51,0)
ctrl = 1

;===============================================================================
;===============================================================================

[Statedef 4650]
physics = N
anim = 4650

[State 4650]
type = AssertSpecial
trigger1 = 1
flag = invisible

[State explod]
type = Explod
trigger1 = time = 0
anim = 4650+random%5
ID = 4650
removetime = 32
sprpriority = 5

[State pal]
type = PalFX
trigger1 = time = 0
time = 52
sinadd = -256,-256,-256,128
ignorehitpause = 1

[State var]
type = varset
trigger1 = time = 0
fvar(2) = .5
[State var]
type = varadd
trigger1 = time >= 1
fvar(2) = 1
ignorehitpause = 1

[State explod]
type = ModifyExplod
trigger1 = 1
ID = 4650
scale = .5+fvar(2)/16,.5+fvar(2)/16
ignorehitpause = 1

[State end]
type = DestroySelf
trigger1 = time = 32

;===============================================================================
;===============================================================================
; Psych Burst
[Statedef 970]
type = A
movetype = I
physics = N
anim = 970
velset = 0,-6.5
ctrl = 1
ctrl = 0
facep2 = 1

[State var]
type = varadd
trigger1 = time = 0
fvar(10) = -ifelse(((prevstateno!=[150,155])&&prevstateno!=[5000,5109]),1000,1500)
persistent = 1
ignorehitpause = 0

[State var]
type = varadd
trigger1 =(prevstateno = [150,155])|| prevstateno = [5000,5109]
trigger1 = movehit && roundstate = 2
fvar(10) = 500
persistent = 1
ignorehitpause = 0


[State hit]
type = NotHitBy
trigger1 = time = [0,13]
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State pal]
type = PalFX
trigger1 = time = 0
time = 50
sinadd = 999,999,999,999
ignorehitpause = 0

[State snd]
type = PlaySnd
trigger1 = time = 12
value = 4460,0

[State type]
type = StateTypeSet
trigger1 = time = [13,20]
movetype = A

[State hit]
type = HitDef
trigger1 = 1
trigger1 = numhelper(9100) = 0
attr = A,HA
guardflag = MA
animtype = back
damage =  Ceil(0.04 * enemy,Const(data.life)),Ceil(0.05 * enemy,Const(data.life))
pausetime = 0,1
sparkno = s9402
guard.sparkno = s9480
sparkxy = -10,-50
hitsound = s4020,0
guardsound = s4420,0
ground.slidetime = 20
ground.hittime = 20
yaccel = .55
ground.velocity = -18,-17
air.velocity = -18,-17
airguard.velocity = -13,-14
ground.cornerpush.veloff = 0
p2facing = 1
fall = 1
fall.yvelocity = -4
fall.recover = 0
getpower = 100

[State hit]
type = HitDef
trigger1 = 1
trigger1 = numhelper(9100) = 1
attr = A,HA
guardflag = MA
animtype = back
damage =  Ceil(0.06 * enemy,Const(data.life)),Ceil(0.05 * enemy,Const(data.life))
pausetime = 0,1
sparkno = s9403
guard.sparkno = s9480
sparkxy = -10,-50
hitsound = s4020,0
guardsound = s4420,0
ground.slidetime = 20
ground.hittime = 20
yaccel = .55
ground.velocity = -18,-17
air.velocity = -18,-17
airguard.velocity = -13,-14
ground.cornerpush.veloff = 0
p2facing = 1
fall = 1
fall.yvelocity = -4
fall.recover = 0
getpower = 100

[State target]
type = TargetState
trigger1 = movehit
value = 5060
persistent = 0
ignorehitpause = 1

[State vel]
type = velset
trigger1 = time = [10,19]
y = 0
[State vel]
type = veladd
trigger1 = time >= 20
y = .45

[State type]
type = StateTypeSet
trigger1 = time >= 21
movetype = I

[State land]
type = ChangeState
trigger1 = pos y >= 0 && vel y > 0
value = 52
ctrl = 1
ctrl = 0

;===============================================================================
;===============================================================================
; Super Dizzy
[Statedef 990]
type = S
movetype = I
physics = S
anim = 990
velset = 0,0
ctrl = 0


[State 990]
type = Projectile
trigger1 = time = [0,500]
trigger1 = P2Life != 0
projanim = 15000
projremovetime = 1
attr = SCA, NA, SA, HA, NP, SP, HP, NT, ST, HT, AA, AT, AP
reversal.attr = SCA, NA, SA, HA, NP, SP, HP, NT, ST, HT, AA, AT, AP
damage = 0,0
numhits = 0
guardflag =
pausetime = 0,0
sparkno = 78
p2stateno = 5000
hitsound = 0,0
guardsound = 0,0

[State 990, TargetPowerAdd]
type = TargetPowerAdd
trigger1 = time = [0,500]
trigger1 = P2Life != 0
value = -100000

[State 990, snd]
type=playsnd
trigger1= animelem=1
value=7500,2

[State 990]
type = AssertSpecial
trigger1 = 1
flag = nomusic
flag2 = intro
flag3 = roundnotover

[State 990];
type = assertspecial
trigger1 = 1
flag = NoBarDisplay
flag2 = timerfreeze

[State pal]
type = BGPalFX
trigger1 = animelem = 1
time = 65
sinadd = -128,-128,-64,104
ignorehitpause = 1
[State pal]
type = BGPalFX
trigger1 = time >= 1
time = 150
add = -128,-128,-64
sinadd = 128,128,64,104
ignorehitpause = 1

[State 990]
type = lifeadd
trigger1 = time = 0
value = 99999
ignorehitpause = 1

[State 990, superchargepause]
type=superpause
trigger1=!time
time=150
anim=-1
sound=s4500,0
poweradd=-3000
p2defmul=1
darken=0

[State pal]
type = BGPalFX
trigger1 = time = 1
time = 150
sinadd = -128,-128,-64,156
ignorehitpause = 1


[State 990, super effect]
type = Explod
trigger1 = timemod = 100,0
anim = 4500
removetime = 64
pos= 0,-80
supermove = 1
sprpriority = 5


[State 990, super effect]
type = Explod
trigger1 = timemod = 100,0
anim = 4501
removetime = 64
pos= 0,-80
supermove = 1
sprpriority = 5

[State 990, super effect]
type = Explod
trigger1 = timemod = 100,0
anim = 4502
removetime = 64
pos= 0,-80
supermove = 1
sprpriority = 5


[State Omni-Psych Helper]
type = Helper
trigger1 = 1
trigger1 = numhelper(9100) = 0
helpertype = normal
name = "Omni-Psych Helper"
stateno = 9100
ID = 9100
ownpal = 1
supermovetime = 9999
ignorehitpause = 1

[State snd]
type = PlaySnd
trigger1 = time = 1
value = 994,0

[State 990]
type = PlaySnd
trigger1 = time = 1
value = 4500,0

[State 990]
type = PlaySnd
trigger1 = time = 1
value = 2201,1

[State 990]
type = PlaySnd
trigger1 = animelem = 20
value = 192,531


[State end]
type = ChangeState
trigger1 = animtime = 0
value = 51
ctrl = 1

;===============================================================================
;===============================================================================
; instant kill effect
[Statedef 4690]
type = A
movetype = I
physics = N
anim = 4690
velset = 0,0
ctrl = 1
sprpriority = 2

[State 4690]
type = AssertSpecial
trigger1 = 1
flag = invisible

[State explod]
type = ModifyExplod
trigger1 = 1
ID = 4690
scale = .1+fvar(2)/10,fvar(3)
ignorehitpause = 1
[State explod]
type = ModifyExplod
trigger1 = 1
ID = 4691
scale = .1+fvar(4)/10,fvar(3)
ignorehitpause = 1

[State explod]
type = Explod
trigger1 = time = 0
anim = 4690
ID = 4690
pos = 0,5
vel = 0,-.5-(random&50)/50
random = 120,0
removetime = 52
sprpriority = 5
[State explod]
type = Explod
trigger1 = time = 0
anim = 4690
ID = 4691
vel = 0,-.5-(random&50)/50
random = 120,0
removetime = 52
sprpriority = -5

[State pal]
type = PalFX
trigger1 = time = 0
time = 1
sinadd = -256,-256,-256,208
ignorehitpause = 1

[State explod]
type = RemoveExplod
trigger1 = time = 52
[State end]
type = DestroySelf
trigger1 = time = 52


;===============================================================================
;===============================================================================
;---------------------------------------------------------------------------
; Hit_ground (shaking)
[Statedef 5000]
type = U
movetype = H
physics = N
velset = 0,0

[State defence]
type = DefenceMulSet
trigger1 = numhelper(9100) = 1
trigger1 = hitover
value = 1

[State 5000]
type = SelfState
trigger1 = statetype = A
value = 5020

[State anim]
type = ChangeAnim
trigger1 = time = 0 && statetype = S
trigger1 = gethitvar(animtype)!= [3,5]
value = ifelse((gethitvar(groundtype)=1),5000,5010)+gethitvar(animtype)
[State anim]
type = ChangeAnim
trigger1 = time = 0 && statetype = C
trigger1 = gethitvar(animtype)!= [3,5]
value = 5020+gethitvar(animtype)

[State anim]
type = ChangeAnim
trigger1 = time = 0 && statetype!= A
trigger1 = gethitvar(animtype)!= [3,5]
trigger1 = gethitvar(chainID) = 4090
trigger1 = selfanimexist(5003)
value = 5003

[State anim]
type = ChangeAnim
trigger1 = time = 0
trigger1 = gethitvar(animtype) = [3,5]
value = 5030

[State anim]
type = ChangeAnim
trigger1 = time = 0
trigger1 =(gethitvar(animtype)=[4,5])&&(selfanimexist(5047+gethitvar(animtype)))
value = 5047+gethitvar(animtype)

[State anim]
type = ChangeAnim
trigger1 = time > 0
value = anim

[State type]
type = StateTypeSet
trigger1 = time = 0
trigger1 = gethitvar(yvel)!= 0 && gethitvar(fall)
trigger2 = pos y!= 0
type = A

[State 5000]
type = ChangeState
trigger1 = hitshakeover
trigger1 = gethitvar(yvel) = 0
value = 5001

[State 5000]
type = SelfState
trigger1 = hitshakeover
value = 5030

;---------------------------------------------------------------------------
; Hit_ground (slide)
[Statedef 5001]
type = U
movetype = H

[State defence]
type = DefenceMulSet
trigger1 = numhelper(9100) = 1
trigger1 = hitover
value = 1

[State type]
type = StateTypeSet
trigger1 = time = 0 && statetype = S
physics = S
[State type]
type = StateTypeSet
trigger1 = time = 0 && statetype = C
physics = C

[State vel]
type = HitVelSet
trigger1 = time = 0
x = 1
[State vel]
type = velset
trigger1 = anim = 5003 && time = 0
x = -6

[State anim]
type = ChangeAnim
trigger1 = animtime = 0
value = anim+5
persistent = 0

[State vel]
type = velmul
trigger1 = time >= gethitvar(slidetime)
x = .6

[State vel]
type = velset
trigger1 = anim!= 5008 && hitover
trigger2 = anim = 5008 && animtime = 0
x = 0

[State defence]
type = DefenceMulSet
trigger1 = anim!= 5008 && hitover
trigger2 = anim = 5008 && animtime = 0
value = 1

[State end]
type = SelfState
trigger1 = anim!= 5008 && hitover
trigger2 = anim = 5008 && animtime = 0
value = 0+(statetype=C)*11
ctrl = 1

;------------------------------------------------------------------
; Air fall -- hit back (shaking)
[Statedef 5060]
type = A
movetype = H
physics = N
velset = 0,0
ctrl = 1

[State defence]
type = DefenceMulSet
trigger1 = numhelper(9100) = 1
trigger1 = hitover
value = 1

[State anim]
type = ChangeAnim
trigger1 = 1
value = 5030

[State vel]
type = HitVelSet
trigger1 = hitshakeover = 1
x = 1
y = 1

[State 5060]
type = ChangeState
trigger1 = hitshakeover = 1
value = 5061

; Air fall -- hit back (knocked up, falling)
[Statedef 5061]
type = A
movetype = H
physics = N
ctrl = 1

[State defence]
type = DefenceMulSet
trigger1 = numhelper(9100) = 1
trigger1 = hitover
value = 1


[State anim]
type = ChangeAnim
trigger1 = time = 0
value = 5050

[State anim]
type = ChangeAnim
trigger1 = anim = [5050,5059]
trigger1 = vel y >= ifelse(anim=5050,1,-2)
trigger1 = selfanimexist(anim+10)
value = anim+10
persistent = 0

[State vel]
type = veladd
trigger1 = 1
y = gethitvar(yaccel)

[State 5061]
type = ChangeState
trigger1 = backedgedist < 5 && pos y < 5
value = 5062

[State end]
type = SelfState
trigger1 = vel y > 0
trigger1 = pos y >= ifelse((anim=[5051,5059])||(anim=[5061,5069]),0,25)
value = 5100

; Air fall -- hit back (wire damage)
[Statedef 5062]
type = A
movetype = H
physics = N
velset = 0,0

[State defence]
type = DefenceMulSet
trigger1 = numhelper(9100) = 1
trigger1 = hitover
value = 1

[State anim]
type = ChangeAnim
trigger1 = time = 0
value = 5030

[State explod]
type = Explod
trigger1 = time = 0
anim = f2
pos = 0,const(size.mid.pos.y)
sprpriority = 2
ownpal = 1
[State snd]
type = PlaySnd
trigger1 = time = 0
value = f7,0
[State 5062]
type = EnvShake
trigger1 = time = 0
time = 6

[State anim]
type = ChangeAnim
trigger1 = time = 5
trigger1 =!selfanimexist(5071)
value = 5070
[State anim]
type = ChangeAnim
trigger1 = time = 5
trigger1 = selfanimexist(5071)
value = ifelse((gethitvar(animtype)=4),5071,5070)

[State vel]
type = HitVelSet
trigger1 = time = 5
x = 1
y = 1

[State vel]
type = velset
trigger1 = time = 5
x = (vel x)*-.25
y = (vel y)*.75

[State vel]
type = veladd
trigger1 = time >= 5
y = .45

[State Recover]
type = SelfState
triggerall = time >= 5
triggerall = vel y > -1
triggerall = alive && canrecover
trigger1 = command = "recovery"
value = 5200

[State anim]
type = ChangeAnim
trigger1 = anim = 5071
trigger1 = selfanimexist(5071)
trigger1 = pos y >= 15 && vel y > 0
value = 5161

[State end]
type = SelfState
trigger1 = pos y >= 15 && vel y > 0
value = 5110
ctrl = 1

;---------------------------------------------------------------------------
; Hit_fallrecover (still falling)
[Statedef 5200]
type = A
movetype = H
physics = N

[State Recover in mid air]
type = ChangeState
trigger1 = pos y < -10
value = 5210

[State Change anim if done with transition]
type = ChangeAnim
trigger1 = anim = 5035
trigger1 = animtime = 0
value = 5050

[State vel]
type = veladd
trigger1 = 1
y = gethitvar(yaccel)

[State Recover near ground]
type = SelfState
trigger1 = selfanimexist(5200)
trigger1 = pos y >= 10 && vel y > 0
value = 5210

[State end]
type = SelfState
trigger1 = pos y >= 10 && vel y > 0
value = 5100

[StateDef 4620]
physics = N
anim = 4620


[State 4620]
type = AssertSpecial
trigger1 = 1
flag = invisible

[State snd]
type = PlaySnd
trigger1 = time = 0
value = 5201,0

[State pal]
type = PalFX
trigger1 = time = 0
time = 26
sinadd = -64,-64,-64,104
ignorehitpause = 1

[State explod]
type = Explod
trigger1 = time = 0
anim = 4620
ID = 4620
removetime = 26
sprpriority = 5

[State var]
type = varset
trigger1 = time = 0
fvar(2) = .5
[State var]
type = varadd
trigger1 = time >= 1
fvar(2) = 1
ignorehitpause = 1

[State explod]
type = ModifyExplod
trigger1 = 1
ID = 4620
scale = .5+fvar(2)/128,.5+fvar(2)/128
ignorehitpause = 1

[State end]
type = DestroySelf
trigger1 = time = 26

;===============================================================================
;===============================================================================
; Dizzy
[Statedef 5300]
type = S
movetype = H
physics = S
anim = 5300
velset = 0,0
ctrl = 1

[State pos]
type = posset
trigger1 = time = 0
y = 0

[State 5300]
type = ChangeState
triggerall = selfanimexist(5301)
trigger1 = time = 1
value = 5301

[State vel]
type = velset
trigger1 = time = 1
x = -1
y = -4

[State end]
type = SelfState
trigger1 = time = 125
value = 5050
ctrl = 1

;===============================================================================
;===============================================================================

[Statedef 5301]
type = S
movetype = H
physics = S
anim = 5301
velset = 0,0
ctrl = 1


[State end]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1


;===============================================================================
;===============================================================================
[Statedef 5400]
type=A
physics=N
movetype=H
anim=5400
ctrl=0
velset=0,0
sprpriority=3
movehitpersist=1


[State 5400]
type=varset
trigger1= 1
var(57)=0
[State 5400]
type=varset
trigger1= 1
var(56)=1
[State 5400]
type=powerset
trigger1= 1
value=0

[State 5400]
type=veladd
trigger1=time>=120
y=.1

[State 5400]
type=changestate
trigger1=pos y>-vel y
value=5100

;===============================================================================
;===============================================================================
; Faultless defense effect (helper)
[StateDef 4490]
type = A
movetype = I
physics = N
anim = 4490
velset = 0,0
ctrl = 0

[State 4490]
type = AssertSpecial
trigger1 = 1
flag = invisible

[State pal]
type = PalFX
trigger1 = 1
time = 13
add = 228,228,228
sinadd = -256,-256,-256,104
ignorehitpause = 1

[State 4490]
type = NotHitBy
trigger1 = numhelper(4490) = 1
value = SCA, NA, SA, HA, NP, SP, HP, NT, ST, HT, AA, AT, AP


[State explod]
type = Explod
trigger1 = numexplod(4490) = 0 && time = 0
anim = 4490
ID = 4490
bindtime = -1
removetime = -1
scale = .5,.5
sprpriority = 5
removeongethit = 1
persistent = 0

[State bind]
type = BindToParent
trigger1 = 1
pos = 0,const(size.mid.pos.y)/(1+(parent,statetype=C))+15*(parent,statetype=S)

[State faultless defense effect]
type = ChangeState
trigger1 = parent,fvar(4) = 0 || parent,stateno!= [120,155]
trigger2 = parent,power = 0 || roundstate>= 3
value = 4491

[StateDef 4491]
physics = N
anim = 4491

[State 4491]
type = AssertSpecial
trigger1 = 1
flag = invisible

[State explod]
type = RemoveExplod
trigger1 = time = 0
ID = 4490
ignorehitpause = 1

[State explod]
type = Explod
trigger1 = time = 0
anim = 4491
ID = 4491
removetime = 13
sprpriority = 5

[State var]
type = varset
trigger1 = time = 0
fvar(2) = .5
[State var]
type = varadd
trigger1 = time >= 1
fvar(2) = 1
ignorehitpause = 1

[State explod]
type = ModifyExplod
trigger1 = 1
ID = 4491
scale = .5+fvar(2)/64,.5+fvar(2)/64
ignorehitpause = 1

[State end]
type = DestroySelf
trigger1 = time = 13

;===============================================================================
;===============================================================================
; Super effect
[Statedef 4500]
type = A
movetype = I
physics = N
anim = 4500
ctrl = 0
sprpriority = 5

[State 4500]
type = AssertSpecial
trigger1 = 1
flag = invisible

[State image]
type = AfterImage
trigger1 = time = 1
time = 32
length = 5
paladd = -20,-20,-20
palmul = .95,.95,.95
timegap = 2
framegap = 2
trans = add

[State pal]
type = PalFX
trigger1 = time = 0
time = 8
add = -256,-256,-256
sinadd = 256,256,256,32
ignorehitpause = 1
[State pal]
type = PalFX
trigger1 = time = 23
time = 42
sinadd = -256,-256,-256,168
ignorehitpause = 1

[State super effect]
type = Explod
trigger1 = time = 1
anim = 4500
removetime = 64
supermove = 1
sprpriority = 5

[State super effect]
type = Explod
trigger1 = time = 1
anim = 4501
ID = 4501
removetime = 64
supermove = 1
scale = .5,.5
sprpriority = 5

[State var]
type = varadd
trigger1 = 1
fvar(2) = ifelse(time>=36,1,.75)
[State explod]
type = ModifyExplod
trigger1 = 1
ID = 4501
scale = fvar(2)/64.0,fvar(2)/64.0
ignorehitpause = 1

[State super effect]
type = Helper
trigger1 = time = 0
name = "super_1"
stateno = 4502
ownpal = 1
supermovetime = 9999

[State super effect]
type = Helper
trigger1 = time = [0,2]
name = "super_2"
stateno = 4503
pos = 120-(random&240),120-(random&240)
ownpal = 1
supermovetime = 9999
size.xscale = 99.5
size.yscale = 99.5
[State super effect]
type = Helper
trigger1 = time = [0,2]
name = "super_2"
stateno = 4503
pos = 150-(random&300),100-(random&200)
ownpal = 1
supermovetime = 9999
size.xscale = .5
size.yscale = .5
[State super effect]
type = Helper
trigger1 = time = [0,2]
name = "super_2"
stateno = 4503
pos = 180-(random&360),80-(random&160)
ownpal = 1
supermovetime = 9999
size.xscale = .5
size.yscale = .5

[State explod]
type = RemoveExplod
trigger1 = time = 78
[State end]
type = DestroySelf
trigger1 = time = 78

;===============================================================================
;===============================================================================

[Statedef 4502]
type = A
movetype = I
physics = N
anim = 4502
ctrl = 0

[State 4502]
type = AssertSpecial
trigger1 = 1
flag = invisible

[State pal]
type = PalFX
trigger1 = time = 0
time = 26
sinadd = -256,-256,-256,104
ignorehitpause = 1

[State super effect]
type = Explod
trigger1 = time = 0
anim = 4502
pos = -240,240
removetime = 26
supermove = 1
scale = .5,.5
sprpriority = 5
[State super effect]
type = Explod
trigger1 = time = 0
anim = 4502
removetime = 26
supermove = 1
scale = .5,.5
sprpriority = 5
[State super effect]
type = Explod
trigger1 = time = 0
anim = 4502
pos = 240,-240
removetime = 26
supermove = 1
scale = .5,.5
sprpriority = 5

[State explod]
type = RemoveExplod
trigger1 = time = 26
[State end]
type = DestroySelf
trigger1 = time = 26

;===============================================================================
;===============================================================================

[Statedef 4503]
type = A
movetype = I
physics = N
anim = 4503
velset = 0,0
ctrl = 0
sprpriority = 5

[State 4503]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State var]
type = varset
trigger1 = time = 0
fvar(2) = parentdist x
[State var]
type = varset
trigger1 = time = 0
fvar(3) = parentdist y

[State vel]
type = veladd
trigger1 = time >= 1
x = fvar(2)/300
y = fvar(3)/300

[State pal]
type = PalFX
trigger1 = time = 0
time = 8
add = -256,-256,-256
sinadd = 256,256,256,32
ignorehitpause = 1
[State pal]
type = PalFX
trigger1 = time = 8
time = 32
sinadd = -256,-256,-256,128
ignorehitpause = 1

[State end]
type = DestroySelf
trigger1 =(parentdist x = [-9,9])&& parentdist y = [-9,9]
trigger2 = time = 40

;===============================================================================
;===============================================================================
; Dust attack effect
[Statedef 4550]
type = A
physics = N
anim = 4550
ctrl = 1
sprpriority = -5

[State 4550]
type = AssertSpecial
trigger1 = 1
flag = invisible
[State pos]
type = posset
trigger1 = 1
x = root,screenpos x-160
ignorehitpause = 1

[State pos]
type = posadd
trigger1 = root,fvar(14) = 1
trigger1 = rootdist y!= [175,185]
y = ifelse(rootdist y<180,-10,10)

[State vel]
type = velset
trigger1 = root,fvar(14) = 0
trigger1 = rootdist y!= [-5,5]
y = ifelse(rootdist y<0,-1,1)*10

[State explod]
type = RemoveExplod
trigger1 = root,fvar(14) = 0
[State end]
type = DestroySelf
trigger1 = root,fvar(14) = 0
trigger1 = rootdist y = [-5,5]

;===============================================================================
;===============================================================================
; Omni-Psych Helper
[Statedef 9100]
physics = N
anim = 9100
ctrl = 0

[State 9100, safety]
type=selfstate
trigger1=!ishelper
value=0

[State 9100]
type = DefenceMulSet
trigger1 = 1
value = 0.0



[State var]
type = varset
trigger1 = time = 0
fvar(10) = parent,power
ignorehitpause = 1

[State 9100]
type = AssertSpecial
trigger1 = 1
flag = invisible

[State var]
type = varset
trigger1 = time = 0
fvar(2) = 0
ignorehitpause = 1
[State var]
type = varadd
trigger1 = time = [1,5]
fvar(2) = .1
ignorehitpause = 1



[State var]
type = varadd
trigger1 = fvar(10) > 0 && parent,stateno!= 990
fvar(10) = -2
ignorehitpause = 1

[State var]
type = varadd
trigger1 = fvar(10) > 0 && parent,stateno!= 192
fvar(10) = -2
ignorehitpause = 1


;===============================================================================
;===============================================================================

[Statedef 9101]
physics = N

[State 9101]
type = AssertSpecial
trigger1 = 1
flag = invisible

[State var]
type = varset
trigger1 = time = 0
fvar(2) = .5
[State var]
type = varadd
trigger1 = time = [1,5]
fvar(2) = -.1
ignorehitpause = 1

[State explod]
type = ModifyExplod
trigger1 = 1
scale = .5,fvar(2)
ignorehitpause = 1
[State explod]
type = ModifyExplod
trigger1 = 1
ID = 9102
scale = fvar(10)/4000.0,fvar(2)
ignorehitpause = 1

[State explod]
type = RemoveExplod
trigger1 = time = 5
ignorehitpause = 1
[State end]
type = DestroySelf
trigger1 = time = 5
ignorehitpause = 1

;===============================================================================
;===============================================================================
; God effect
[Statedef 7777]
type = A
movetype = I
physics = N
anim = 7777
ctrl = 0
sprpriority = 5

[State 7777]
type = AssertSpecial
trigger1 = 1
flag = invisible

[State super effect]
type = Explod
trigger1 = time = 1
anim = 7777
removetime = 64
supermove = 1
sprpriority = 5

[State super effect]
type = Explod
trigger1 = time = 1
anim = 7777
ID = 7777
removetime = 64
supermove = 1
scale = .1,.1
sprpriority = 5

[State explod]
type = RemoveExplod
trigger1 = time = 78
[State end]
type = DestroySelf
trigger1 = time = 78

;===============================================================================
;===============================================================================
; God effect 2
[Statedef 7776]
type = A
movetype = I
physics = N
anim = 7776
ctrl = 0
sprpriority = 5

[State 7776]
type = AssertSpecial
trigger1 = 1
flag = invisible

[State super effect]
type = Explod
trigger1 = time = 1
anim = 7776
removetime = 64
supermove = 1
sprpriority = 5

[State super effect]
type = Explod
trigger1 = time = 1
anim = 7776
ID = 7776
removetime = 64
supermove = 1
scale = .1,.1
sprpriority = 5

[State explod]
type = RemoveExplod
trigger1 = time = 78
[State end]
type = DestroySelf
trigger1 = time = 78


;==========================Omni-Psych=AI=Helper=================================
[StateDef 9741]
anim=9741
ctrl=0
[State 9741, safety]
type=selfstate
trigger1=!ishelper
value=0

[State 9741, facing]
type=turn
trigger1=facing!=root,facing
[State 9741, pausecheck]
type=varset
trigger1=(root,movecontact)&&!(root,ctrl)
trigger2=(facing!=root,facing)
var(0)=0

[State 9741, dirturnonAI]
type=parentvarset
triggerall=var(0)
trigger1=(root,command="up")||(root,command="down")||(root,command="back")||(root,command="fwd")
var(59)=1
[State 9741, dirturnoffAI]
type=parentvarset
trigger1=(command="up")&&(root,command="up")
trigger2=(command="down")&&(root,command="down")
trigger3=(command="back")&&(root,command="back")
trigger4=(command="fwd")&&(root,command="fwd")
var(59)=-1
[State 9741, buttonturnonAI]
type=parentvarset
triggerall=var(0)
trigger1=(root,command="a")||(root,command="b")||(root,command="c")||(root,command="x")
trigger2=(root,command="y")||(root,command="z")||(root,command="start")
var(59)=1
[State 9741, buttonturnoffAI]
type=parentvarset
trigger1=(command="a")&&(root,command="a")
trigger2=(command="b")&&(root,command="b")
trigger3=(command="c")&&(root,command="c")
trigger4=(command="x")&&(root,command="x")
trigger5=(command="y")&&(root,command="y")
trigger6=(command="z")&&(root,command="z")
trigger7=(command="start")&&(root,command="start")
var(59)=-1
[State 9741, unpausecheck]
type=varset
trigger1=root,ctrl
var(0)=1

[State 9741, AIonAI]
type=parentvarset
triggerall=var(0)
trigger1= root,command="AI"
var(59)=1


;=======================Omni-Psych=Armor=Helper=================================

